import Vue from 'vue';

// 需要手动安装 npm install vue-router@3.5.3 --save
import VueRouter from 'vue-router';

import home from '../pages/home.vue';
import index from '../pages/index/index.vue';

Vue.use(VueRouter);

// Step1 设置路由
const routes = [
	{
		path: '/',
		name: 'home',
		component: home,
	},
	{
		path: '/index',
		name: 'index',
		component: index,
	}

	// {
	// 	path: '/',
	// 	name: 'index',
	// 	component: index,
	// },
];

// Step2 routes放入router中进行渲染
const router = new VueRouter({
	routes,
});

// Step3 router需要放入实例中去
export default router;
